
public class Shot extends SpaceObject{

	//Constant move space, can't change ingame
	//needs testing to make sure it moves fast enough
	private double moveSpeed=-250;
	private boolean used = false;
	GameMain game;
	/**
	 * Constructor
	 */
	
	public Shot(GameMain game,String spr, int x, int y)
	{
		super(spr,x,y);
		this.game=game;
		yVel=moveSpeed;
	}
	
	/**
	 * Move Method up and down only
	 */
	public void move(long del){
		super.move(del);
		
		//remove entity if off screen
		if(y<-30)
		{
			game.removeSpaceObject(this);
		}
	}

	@Override
	public void collidedWith(SpaceObject other) {


		if(used){
			return;
		}
		
		if(other instanceof EnemyObject)
		{
			game.removeSpaceObject(this);
			game.removeSpaceObject(other);
			
			game.notifyEnemyKilled();
			used=true;
		}
	}
	
	
}
